\(\int \cos (c+d x) \sqrt {a+a \sec (c+d x)} (A+C \sec ^2(c+d x)) \, dx\) [160]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 33, antiderivative size = 94 \[ \int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \left (A+C \sec ^2(c+d x)\right ) \, dx=\frac {\sqrt {a} A \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}+\frac {A \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{d}-\frac {a (A-2 C) \tan (c+d x)}{d \sqrt {a+a \sec (c+d x)}} \]

[Out]

A*arctan(a^(1/2)*tan(d*x+c)/(a+a*sec(d*x+c))^(1/2))*a^(1/2)/d+A*sin(d*x+c)*(a+a*sec(d*x+c))^(1/2)/d-a*(A-2*C)*
tan(d*x+c)/d/(a+a*sec(d*x+c))^(1/2)

Rubi [A] (verified)

Time = 0.24 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.152, Rules used = {4172, 4000, 3859, 209, 3877} \[ \int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \left (A+C \sec ^2(c+d x)\right ) \, dx=\frac {\sqrt {a} A \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{d}-\frac {a (A-2 C) \tan (c+d x)}{d \sqrt {a \sec (c+d x)+a}}+\frac {A \sin (c+d x) \sqrt {a \sec (c+d x)+a}}{d} \]

[In]

Int[Cos[c + d*x]*Sqrt[a + a*Sec[c + d*x]]*(A + C*Sec[c + d*x]^2),x]

[Out]

(Sqrt[a]*A*ArcTan[(Sqrt[a]*Tan[c + d*x])/Sqrt[a + a*Sec[c + d*x]]])/d + (A*Sqrt[a + a*Sec[c + d*x]]*Sin[c + d*
x])/d - (a*(A - 2*C)*Tan[c + d*x])/(d*Sqrt[a + a*Sec[c + d*x]])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 3859

Int[Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[-2*(b/d), Subst[Int[1/(a + x^2), x], x, b*(C
ot[c + d*x]/Sqrt[a + b*Csc[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 3877

Int[csc[(e_.) + (f_.)*(x_)]*Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[-2*b*(Cot[e + f*x]/(
f*Sqrt[a + b*Csc[e + f*x]])), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

Rule 4000

Int[Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)]*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Dist[c, In
t[Sqrt[a + b*Csc[e + f*x]], x], x] + Dist[d, Int[Sqrt[a + b*Csc[e + f*x]]*Csc[e + f*x], x], x] /; FreeQ[{a, b,
 c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0]

Rule 4172

Int[((A_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b
_.) + (a_))^(m_), x_Symbol] :> Simp[A*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Csc[e + f*x])^n/(f*n)), x] - Dis
t[1/(b*d*n), Int[(a + b*Csc[e + f*x])^m*(d*Csc[e + f*x])^(n + 1)*Simp[a*A*m - b*(A*(m + n + 1) + C*n)*Csc[e +
f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, C, m}, x] && EqQ[a^2 - b^2, 0] &&  !LtQ[m, -2^(-1)] && (LtQ[n, -2
^(-1)] || EqQ[m + n + 1, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {A \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{d}+\frac {\int \sqrt {a+a \sec (c+d x)} \left (\frac {a A}{2}-\frac {1}{2} a (A-2 C) \sec (c+d x)\right ) \, dx}{a} \\ & = \frac {A \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{d}+\frac {1}{2} A \int \sqrt {a+a \sec (c+d x)} \, dx+\frac {1}{2} (-A+2 C) \int \sec (c+d x) \sqrt {a+a \sec (c+d x)} \, dx \\ & = \frac {A \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{d}-\frac {a (A-2 C) \tan (c+d x)}{d \sqrt {a+a \sec (c+d x)}}-\frac {(a A) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d} \\ & = \frac {\sqrt {a} A \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}+\frac {A \sqrt {a+a \sec (c+d x)} \sin (c+d x)}{d}-\frac {a (A-2 C) \tan (c+d x)}{d \sqrt {a+a \sec (c+d x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.52 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.89 \[ \int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \left (A+C \sec ^2(c+d x)\right ) \, dx=\frac {a \left (A \text {arctanh}\left (\sqrt {1-\sec (c+d x)}\right )+(2 C+A \cos (c+d x)) \sqrt {1-\sec (c+d x)}\right ) \tan (c+d x)}{d \sqrt {1-\sec (c+d x)} \sqrt {a (1+\sec (c+d x))}} \]

[In]

Integrate[Cos[c + d*x]*Sqrt[a + a*Sec[c + d*x]]*(A + C*Sec[c + d*x]^2),x]

[Out]

(a*(A*ArcTanh[Sqrt[1 - Sec[c + d*x]]] + (2*C + A*Cos[c + d*x])*Sqrt[1 - Sec[c + d*x]])*Tan[c + d*x])/(d*Sqrt[1
 - Sec[c + d*x]]*Sqrt[a*(1 + Sec[c + d*x])])

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(176\) vs. \(2(84)=168\).

Time = 0.87 (sec) , antiderivative size = 177, normalized size of antiderivative = 1.88

method result size
default \(\frac {\left (A \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right ) \cos \left (d x +c \right )+A \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right )+A \cos \left (d x +c \right ) \sin \left (d x +c \right )+2 C \sin \left (d x +c \right )\right ) \sqrt {a \left (1+\sec \left (d x +c \right )\right )}}{d \left (\cos \left (d x +c \right )+1\right )}\) \(177\)

[In]

int(cos(d*x+c)*(A+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/d*(A*(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*arctanh(sin(d*x+c)/(cos(d*x+c)+1)/(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)
)*cos(d*x+c)+A*(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*arctanh(sin(d*x+c)/(cos(d*x+c)+1)/(-cos(d*x+c)/(cos(d*x+c)+1
))^(1/2))+A*cos(d*x+c)*sin(d*x+c)+2*C*sin(d*x+c))*(a*(1+sec(d*x+c)))^(1/2)/(cos(d*x+c)+1)

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 258, normalized size of antiderivative = 2.74 \[ \int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \left (A+C \sec ^2(c+d x)\right ) \, dx=\left [\frac {{\left (A \cos \left (d x + c\right ) + A\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) + 2 \, {\left (A \cos \left (d x + c\right ) + 2 \, C\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{2 \, {\left (d \cos \left (d x + c\right ) + d\right )}}, -\frac {{\left (A \cos \left (d x + c\right ) + A\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - {\left (A \cos \left (d x + c\right ) + 2 \, C\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{d \cos \left (d x + c\right ) + d}\right ] \]

[In]

integrate(cos(d*x+c)*(A+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

[1/2*((A*cos(d*x + c) + A)*sqrt(-a)*log((2*a*cos(d*x + c)^2 - 2*sqrt(-a)*sqrt((a*cos(d*x + c) + a)/cos(d*x + c
))*cos(d*x + c)*sin(d*x + c) + a*cos(d*x + c) - a)/(cos(d*x + c) + 1)) + 2*(A*cos(d*x + c) + 2*C)*sqrt((a*cos(
d*x + c) + a)/cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c) + d), -((A*cos(d*x + c) + A)*sqrt(a)*arctan(sqrt((a*
cos(d*x + c) + a)/cos(d*x + c))*cos(d*x + c)/(sqrt(a)*sin(d*x + c))) - (A*cos(d*x + c) + 2*C)*sqrt((a*cos(d*x
+ c) + a)/cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c) + d)]

Sympy [F]

\[ \int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \left (A+C \sec ^2(c+d x)\right ) \, dx=\int \sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )} \left (A + C \sec ^{2}{\left (c + d x \right )}\right ) \cos {\left (c + d x \right )}\, dx \]

[In]

integrate(cos(d*x+c)*(A+C*sec(d*x+c)**2)*(a+a*sec(d*x+c))**(1/2),x)

[Out]

Integral(sqrt(a*(sec(c + d*x) + 1))*(A + C*sec(c + d*x)**2)*cos(c + d*x), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 792 vs. \(2 (84) = 168\).

Time = 0.37 (sec) , antiderivative size = 792, normalized size of antiderivative = 8.43 \[ \int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \left (A+C \sec ^2(c+d x)\right ) \, dx=\text {Too large to display} \]

[In]

integrate(cos(d*x+c)*(A+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

1/4*(2*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*(cos(1/2*arctan2(sin(2*d*x + 2
*c), cos(2*d*x + 2*c) + 1))*sin(d*x + c) - (cos(d*x + c) - 1)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*
c) + 1)))*sqrt(a) + sqrt(a)*(arctan2(-(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)
*(cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))*sin(d*x + c) - cos(d*x + c)*sin(1/2*arctan2(sin(2*d
*x + 2*c), cos(2*d*x + 2*c) + 1))), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*(
cos(d*x + c)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + sin(d*x + c)*sin(1/2*arctan2(sin(2*d*x
 + 2*c), cos(2*d*x + 2*c) + 1))) + 1) - arctan2(-(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c)
 + 1)^(1/4)*(cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))*sin(d*x + c) - cos(d*x + c)*sin(1/2*arct
an2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) +
 1)^(1/4)*(cos(d*x + c)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + sin(d*x + c)*sin(1/2*arctan
2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))) - 1) - arctan2((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*
d*x + 2*c) + 1)^(1/4)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)), (cos(2*d*x + 2*c)^2 + sin(2*d*
x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + 1) + arc
tan2((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*sin(1/2*arctan2(sin(2*d*x + 2*c)
, cos(2*d*x + 2*c) + 1)), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arc
tan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) - 1)))*A/d

Giac [F]

\[ \int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \left (A+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + A\right )} \sqrt {a \sec \left (d x + c\right ) + a} \cos \left (d x + c\right ) \,d x } \]

[In]

integrate(cos(d*x+c)*(A+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="giac")

[Out]

sage0*x

Mupad [F(-1)]

Timed out. \[ \int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \left (A+C \sec ^2(c+d x)\right ) \, dx=\int \cos \left (c+d\,x\right )\,\left (A+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )\,\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}} \,d x \]

[In]

int(cos(c + d*x)*(A + C/cos(c + d*x)^2)*(a + a/cos(c + d*x))^(1/2),x)

[Out]

int(cos(c + d*x)*(A + C/cos(c + d*x)^2)*(a + a/cos(c + d*x))^(1/2), x)